package com.bawei.module_vehicle

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.bawei.lib_common.Router
import com.bawei.module_vehicle.ui.CarFragment
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = Router.Ui.VehicleActivity)
class VehicleActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_vehicle)

        // 防止屏幕旋转等配置变更时重复添加Fragment
        if (savedInstanceState == null) {
            val carFragment = CarFragment() // 创建目标Fragment实例

            // 开启Fragment事务
            supportFragmentManager.beginTransaction()
                .replace(R.id.main, carFragment) // 替换容器内容
                .commit() // 提交事务
        }
    }


}